package com.warm.spring.mvc.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

// 交给Spring 托管
@Component
public class QQListener implements ApplicationListener<MyEvent> {
    //类的执行交给spring 触发

    @Override
    public void onApplicationEvent(MyEvent myEvent) {
        //发送通知
        System.out.println("notice by QQ");
    }
}
